Repository navigation
[AI-Assisted] fix(compressor): report consistent speed-solve results and convergence - #4326
Conversation
Evaluate the selected speed through the fixed-speed chart path, preserve the requested pressure and modes, and expose failures to process validation. Add regression and optimizer coverage for issue #4321.
…g searches Keep pressure convergence mandatory with capacity analysis, reject only typed map failures without stale objectives, and avoid redundant chart-setup solves between tables. Validated 485 tests (0 failures, 0 errors, 1 existing skip), formatter and pre-push gates.
Preserve both independent task-log entries and regenerate engineering coverage. All eight PR Java source/test files remain byte-identical to c1a1796; import current master workflows and documentation unchanged. Validation: 63 focused compressor/optimizer regressions pass; direct Spotless apply/check, documentation search, coverage check, and both pre-commit hook stages pass. Documentation impact: reconcile existing task history and generated coverage only; compressor API documentation and numerical behavior are unchanged by this integration.
|
Coordinated process integration check passed on an isolated current-master tree combining this PR's unchanged compressor/optimizer implementation with #4328's unchanged network implementation: 141 reported tests, zero failures/errors, one existing skip. The selected suites were LoopedPipeNetworkTest, FieldNetworkTopologyTest, FieldWellNetworkProcessUnitTest, ProductionOptimizerCompressorFailureTest and CompressorSpeedSolveConsistencyTest. This PR separately passed 63 focused tests on published integrated head The combined numerical trial was not published into either branch. Keep the merge order #4328 -> #4326 -> repaired #4312, and require CI on each integrated head plus independent domain review. This checks adjacent contracts; it does not qualify compressor OEM maps or field operating limits. |
Extract the existing general-flash ownership fix as a small foundation for parallel compressor and process evaluation. Preserve equations and tolerances. AI-assisted implementation and review.
Stack on the common thermodynamic foundation to keep parallel speed search and forward replay consistent without relaxing compressor or optimizer limits.
Master integration — 2026-10-15
Integrated head
b172a1e153d0bab9313a6b4cdebe9054a5c1b76dincorporates master420b4448a61cbb3e499e7a82cde5b1c996d7397c; verified treeb44348e6ff405c327b9ccbd2c2b824d06bdbf44e. Preserved both task-log entries and regenerated coverage. The compressor and optimizer implementation combines unchanged with the already merged mapped-network and shared mixing corrections. Validation includes compressor forward replay, bottleneck/flow optimization, mapped rejection and field-to-facility acceptance.Validation: 65 focused tests passed, zero failures/errors/skips. Stable direct formatting, both hook stages, documentation search, regenerated coverage/check and whitespace checks passed. Documentation impact: retained the existing implementation guides and task-log entries from both branches; no new API, physics or tolerance change is introduced by this integration. Earlier evidence below applies to its recorded checkpoints. Integration follows the user's explicit instruction to merge in dependency order; new-head hosted CI is tracked separately.
Coordination and merge gates — 2026-10-14
Reviewed published head:
22d62de4f243d0a2ae7ee946f6621d02f9641776.The integrated head preserves the original compressor/optimizer implementation and tests. Current Java 8 Ubuntu and Windows jobs remain active; the other checks pass. The corrected #4328 head has now passed an isolated combined 145-test trial with this head (one existing skip), replacing the earlier pending combined-trial claim. No human approval is recorded.
Require the process owner, independent compressor/optimization-domain review and independent maintainer coverage for the new diagnostics, exception subtype and
solved()behavior. One qualified independent maintainer may satisfy both independent roles. Record compatibility classification; a bounded existing-method repair is not automatically an NRC, while an incompatible public failure contract would trigger one.Integration: Prefer corrected #4328 first, then this PR, then repaired #4312. Retain actual fixed-speed replay, requested-target preservation and optimizer rejection of unconverged chart results in the combined tree.
Closes #4321.
Problem and evaluation
The issue reproduces on master
373f10eab27749a3fc7f7e9b022c3bcbdc65bc63(3.25.0 sources). With the public synthetic chart, requested outlets of 6 and 8 bara were published unchanged while independent fixed-speed replay delivered 12.557809 and 12.331552 bara. Even the reachable 14 bara case published the setpoint rather than the computed 13.999581 bara.Master already contains the accepted-root drift fix associated with #3896. This change preserves that behavior. Existing tests explicitly permit speed extrapolation with
limitSpeed=false; the proposed fix preserves this compatibility instead of introducing an unconditional speed-bound exception.Changes
isSpeedSolveConverged()andgetSpeedSolvePressureResidual()(achieved minus requested pressure, bar). Require the final forward result to satisfy the existing 0.001 bar tolerance.solved(),isSimulationValid(), andgetSimulationValidationErrors().ProductionOptimizernow enforces the hardcompressorSpeedSolvegate even with capacity analysis enabled or optional output validation disabled.finallyblock.CI repair and shared optimization fixes
The three current CI errors were reproduced on the original head: both professional lift-curve cases in
FlowRateOptimizerTestand the compressor case inPressureBoundaryOptimizerTest.Compressor.SpeedSolveExceptionsubtype.ProductionOptimizerrecords an infeasible candidate and continues searching without reading stale objectives/downstream constraints. Unrelated exceptions still propagate.FlowRateOptimizerreruns chart setup only when it actually generates a chart. Existing charts remain usable between tables even if the previous sweep ended at an invalid probe; this also removes redundant process runs.Validation
Exact published head:
c1a1796685c0225bb0dfef15f0d3e3861eba2acc. All 11 repair blobs were verified against locally validated Git blob hashes before the leased branch update.OpenJDK 17.0.20; Java 8 source/target through
pomJava8.xml:.github/workflows/practical-optimization-examples.yml, plusCompressorSpeedSolveConsistencyTest,CompressorChartSpeedInterpolationTest,CompressorChartTest,CompressorTest,CompressorTrainTest,CompressorShaftTest,CompressorInletGuideVaneTest,CompressorAntiSurgeControlLineTest,CompressorCurveOptimizationTest,CompressorChartReaderTest,BottleneckAnalysisOptimizerTest,ProductionOptimizerCompressorFailureTest, with-DexcludedTestGroups= -Djacoco.skip=true test: 485 tests, 0 failures, 0 errors, 1 pre-existing disabled network test; exit 0. This includes all 10 slow bottleneck tests and the existing unrelated-exception propagation regression.python3 devtools/run_spotless.py applyandcheck: exit 0; final formatter pass stable.python3 devtools/check_documentation_search.py: exit 0; 788 Markdown pages and 1 HTML page.pre-commit run --all-files --hook-stage pre-commitand--hook-stage pre-push: exit 0.python3 devtools/build_engineering_coverage.py --checkandgit diff --check: exit 0../mvnw -B -f pomJava8.xml -Dsubpackages=neqsim.process.equipment.compressor:neqsim.process.util.optimizer javadoc:javadoc, with an environment-only launcher for the installed JDK module: exit 0, existing documentation warnings.Current CI and merge conditions are recorded above. Earlier validation below/above is evidence for the recorded source revision, not independent human approval.
Documentation impact and limits
Updated the compressor-curve and flow-rate optimization guides, exception/configuration/accessor Javadocs, compressor/anti-surge skill, task log and generated engineering-coverage inventory.
Read actual achieved pressure from the outlet stream;
getOutletPressure()remains the requested setpoint. Pressure convergence does not certify mechanical feasibility when extrapolation is enabled. A failed local search is not proof of global infeasibility on a non-monotonic map. This change detects final pressure errors after anti-surge flow adjustment; it does not add a coupled speed/recycle optimizer.AI-assisted implementation reviewed against the forward-model invariant: the same inlet, chart, options and returned speed must produce the same thermodynamic outlet and shaft power.
Shared thermodynamic foundation — #4333
The Windows Java 8 guide failure exposed a shared thermodynamic-state defect during parallel compressor train evaluation. The speed search and its forward replay could have identical chart flow, head, efficiency and speed but different heat-capacity ratios because classic mixing-rule calculations shared partial-sum fields.
This update incorporates the shared mixing-accumulator foundation. Its source and six deterministic SRK/PR regression cases are identical to the correction already included in #4306. No compressor algorithm, acceptance threshold, optimizer restriction or process limit is changed by this update.
All six interleaving cases fail without the foundation and pass with it. Applying only the corrected mixing-rule class to this PR removed 39 observed intermediate search/replay discrepancies; all four three-train guide examples remained feasible, including staged optimization. Mandatory formatting, pre-commit/pre-push, documentation search, generated coverage and whitespace gates pass on the incremental tree. Local numerical validation used Java 17 with Java 8 source/target; Windows Java 8 CI must requalify the published head.
Merge the shared foundation first, then retain the coordinated #4328 → #4326 → #4312 sequence with final-head checks between merges.
This PR is stacked on #4333. Retarget to master after that foundation merges; keep draft until the new head passes CI and the required independent reviews are recorded.